using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Colorprj
{
    public partial class frmBuyerBillAdj : Form
    {
        Colorprj.Account.AccountManager am = new Colorprj.Account.AccountManager();   
        Colorprj.Masters.BuyerManager bm = new Colorprj.Masters.BuyerManager();  
        public frmBuyerBillAdj()
        {
            InitializeComponent();
        }

        private void PartyBillAdj_Load(object sender, EventArgs e)
        {
            cboBuyer.DataSource = bm.GetAllBuyers().Tables[0];
            cboBuyer.DisplayMember = "BuyerName";
            cboBuyer.ValueMember = "BuyerId"; 

        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            if (cboBuyer.SelectedIndex == -1) {
                MessageBox.Show("please Select Buyer ");
                return;
            }
            try
            {
                if (am.BillAdjustMent(Convert.ToInt16(  cboBuyer.SelectedValue))) {
                    MessageBox.Show("bills adjusted successfully "); 
                }
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);  
            
            }
        }

      
    }
}